package cn.calm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * The primary key class for the t_button database table.
 * 
 */
@Embeddable
public class ButtonPK implements Serializable {
	// default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private String name;

	@Column(name = "dialog_id")
	private String dialogId;

	public ButtonPK() {
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDialogId() {
		return this.dialogId;
	}

	public void setDialogId(String dialogId) {
		this.dialogId = dialogId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ButtonPK)) {
			return false;
		}
		ButtonPK castOther = (ButtonPK) other;
		return this.name.equals(castOther.name)
				&& this.dialogId.equals(castOther.dialogId);

	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.name.hashCode();
		hash = hash * prime + this.dialogId.hashCode();

		return hash;
	}
}